/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.jadum.ejc.endereco.service;

import com.jadum.ejc.endereco.dao.IEnderecoDao;
import com.jadum.ejc.model.Endereco;
import java.util.List;
import org.springframework.transaction.annotation.Transactional;

/**
 *
 * @author Jadum
 */
public class EnderecoService implements IEnderecoService{

    private IEnderecoDao enderecoDao;
    
    
    @Transactional(readOnly = false)
    @Override
    public void adicionarEndereco(Endereco endereco) {
    
        getEnderecoDao().adicionarEndereco(endereco);
        
    }

    
    @Transactional(readOnly = false)
    @Override
    public void atualizarEndereco(Endereco endereco) {
        
        getEnderecoDao().atualizarEndereco(endereco);
        
    }

    
    @Transactional(readOnly = false)
    @Override
    public void excluirEndereco(Endereco endereco) {
    
        getEnderecoDao().excluirEndereco(endereco);
        
    }

    
    @Transactional(readOnly = false)
    @Override
    public Endereco obterEnderecoPorId(int id) {
        
        return getEnderecoDao().obterEnderecoPorId(id);
        
    }

    
    @Override
    public List<Endereco> obterEnderecos() {
        
        return getEnderecoDao().obterEnderecos();
        
    }

    /**
     * @return the enderecoDao
     */
    public IEnderecoDao getEnderecoDao() {
        return enderecoDao;
    }

    /**
     * @param enderecoDao the enderecoDao to set
     */
    public void setEnderecoDao(IEnderecoDao enderecoDao) {
        this.enderecoDao = enderecoDao;
    }
    
}
